Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Genetics in blueberry bush. #57

Closed
wants to merge 9 commits into from

Conversation

arpan98
Copy link

@arpan98 arpan98 commented Mar 21, 2017

Feature for #46 .

Relies on the changes made in the Genome module in this PR: Terasology/Genome#7.

Implemented a genetic system including mutation and breeding from the Genome module into SimpleFarming. Currently implemented only for blueberry, varying the Food filling component.

Might be a little difficult to test due to only one character gene (mutation is the only thing that matters), so try increasing the mutation rate.

Things to do further:

  • Extend to all bushes, vines, trees.
  • Change the look (tiles) of the Seed Mixer. Currently same as a chest.
  • Discuss and decide on a gene to property mapping that allows for effective breeding.
  • Should the user be given some feedback as to how the breeding went? In my opinion, no, to keep it natural.

@arpan98 arpan98 changed the title Genetics Implemented Genetics in blueberry bush. Mar 21, 2017
@Cervator
Copy link
Member

Checked it out real quick and it looks fine, although it is indeed a bit hard to test. Maybe you can think of a debug console command or two to help it out, or some sort of seed examiner item?

It would also help if the UI had a bit more of an indication of what it does. Rather than 4 boxes in a row try to add some minimal decoration so maybe it ends up looking like:

[] + [] -> [][]

@arpan98
Copy link
Author

arpan98 commented Mar 24, 2017

I added a command heldGenomeCheck which returns the genes of the held item. The problem with testing this would be that seeds will almost always have the default gene, unless somehow we are able to randomize the starting genes (while spawning) from a list of possible values. But to test this, in the scope of this PR, you can increase the mutation value to something ridiculous like 0.5 and get different gene values.

@Cervator
Copy link
Member

@xrtariq2594 mind doing a bit of general testing for SimpleFarming then merge this? I can confirm the seed mixer works, but didn't test anything in general (like if seeds with or without mixing actually grow, etc)

@mjuvekar7
Copy link
Contributor

I spoke with @arpan98 and he came up with a general testing guide for this PR. Thought it might be helpful if I sent it here.

  1. give seedmixer 1, place it, fiddle with it.
  2. try give blueberryseed, should give you a blueberry seed with genome F (default). You can use the command heldGenomeCheck to check genome of held item.
  3. Drag blueberries onto the input slots of the seedmixer- only seeds should be able to be dropped on the slots.
  4. Check genome of input and output seeds. If you want, you can fiddle around with the mutation constant in the GenomeSystem to see what works best (I just put in a random value for now).
  5. Try growing the seeds, checking genome of resultant blueberry.


//A=5, F=10, K=15
GeneMutator geneMutator = new VocabularyGeneMutator("ABCDEFGHIJK");
BreedingAlgorithm breedingAlgorithm = new MonoploidBreedingAlgorithm(0, 0.05f, geneMutator);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest you make the mutation chance (the 0.05f parameter here) a separate variable. That would increase readability and would also make it easier to tweak.

@mjuvekar7
Copy link
Contributor

mjuvekar7 commented Apr 19, 2017

Maybe add a second variant of the blueberry with a different genome? Would make testing a lot easier (won't have to wait for random mutations to see genome changes).

@mjuvekar7
Copy link
Contributor

Hey, so because of the recent refactor to this module, I think we might need to rework this whole PR. Adding more commits onto this PR will just make it messy, so I think we should close this one and create a new one. We should still be able to salvage large portions of the code.

Pinging @arpan98 @Cervator

@mjuvekar7
Copy link
Contributor

mjuvekar7 commented Jan 29, 2018

I also think that the Hunger stuff isn't the feature we would want to add first, as it involves adding a dependency to Hunger, which we may or may not want to do (ping @jellysnake. Maybe we should move part of this to EdibleFlora?). I would say we should start off with things like flower/bush color or something simple with two possible varieties (one dominant, one recessive).

@mjuvekar7 mjuvekar7 mentioned this pull request Jan 30, 2018
4 tasks
@skaldarnar
Copy link
Contributor

Sorry for coming back to this only now 🙈 I'm closing this due to date and conflicts.

@skaldarnar skaldarnar closed this Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants